/*AssistCheckInfo  每日自查*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const AssistCheckInfoApi = {

    getPageData(data: any) {
        return request({
            url: "/assistCheckInfo/pageData",
            method: "post",
            data,
        });
    },
    getDetail(data: any) {
        return request({
            url: "/assistCheckInfo/getDetail",
            method: "post",
            data,
        });
    },

    save: (data: any) => {
        return request({
            url: "/assistCheckInfo/save",
            method: "post",
            headersType: 'application/json;charset=UTF-8',
            data,
        });
    },

    del: (data: any) => {
        return request({
            url: "/assistCheckInfo/del",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/assistCheckInfo/updateStatus",
            method: "post",
            data,
        });
    },
    pageDataXls:(_searchParam: any,_xlsTitle: any,_XlsName: any) => {
        const form = new FormData()
        form.append("_searchParam",JSON.stringify(_searchParam))
        form.append("_xlsTitle",JSON.stringify(_xlsTitle))
        return request({
            url: "/assistCheckInfo/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType:'multipart/form-data',
            data: form,
        }).then((res)=> {
            download(res)
        });
    },
    detailPageDataXls:(_searchParam: any,_xlsTitle: any,_XlsName: any) => {
        const params = new URLSearchParams();
        params.append("_searchParam",JSON.stringify(_searchParam))
        params.append("_xlsTitle",JSON.stringify(_xlsTitle))
        return request({
            url: "/assistCheckInfoDetail/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType:'multipart/form-data',
            params
        }).then((res)=> {
            download(res)
        });
    },
        pageDataXlss:(id: any) => {
        const param = new URLSearchParams();
        param.append("id", id)
        return request({
            url: "/assistCheckInfo/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
            params:param,

        }).then((res)=> {
            download(res)
        });
    },
    excelImoprt: (data:any)=>{
        return request({
            url: "/assistCheckInfo/importDataXls",
            method: "post",
            headersType:'multipart/form-data',
            data,
        })

    },
    add: (data:any)=>{
        return request({
            url: "/assistCheckInfo/add",
            headersType: 'application/json;charset=UTF-8',
            method: "post",
            data,
        })
    },
    batchSave: (data:any)=>{
        return request({
            url: "/assistCheckInfo/batchSave",
            headersType: 'application/json;charset=UTF-8',
            method: "post",
            data,
        })
    },
    getDetailPageData:(data: any)=>{
        return request({
            url: "assistCheckInfoDetail/pageData",
            method: "post",
            data
        })
    }
};
export default AssistCheckInfoApi;
